package com.chenyongjing.design.pattern.builder.withdirector;

/**
 * 指挥：核心负责指挥构建一个工程，工程如何构建，由他决定
 */
public class Director {
    /**
     * 指挥工人按照步骤，制造商品
     * @param builder
     * @return
     */
    public Product build(Builder builder){
        builder.buildFirst();
        builder.buildSecond();
        builder.buildThree();
        builder.buildFour();

        return builder.getProduct();
    }
}
